<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<script type="text/javascript">
/**
 * Get the HTML form.
 * @param namespace
 * @param frmName
 * @return
 */
function getForm(namespace, frmName) {
  return document.forms[namespace + frmName];
}

/**
 * Submit the form.
 * @param namespace
 * @param frmName
 * @param eventId
 * @return
 */
function submitAction(namespace, frmName, eventId, dictId) {
  var frm = getForm(namespace, frmName);
  frm.eventId.value = eventId;
  frm.dictId.value = dictId;
  frm.submit();
}

</script>
<portlet:defineObjects />

<form action="<portlet:actionURL/>" name="<portlet:namespace/>ReviewerChecking" method="post">
<input name="eventId" type="hidden" />
<input name="dictId" type="hidden"/>
<input name="screenId" type="hidden" value="reviewerchecking"/>
<table style="width:100%;background:#FF9">
<tr>
			<td colspan="3" style="width:100%;height:50px;background:#0F3">
            Hello ${sessionScope.username}
            <div style="float:right"><input type="submit" value="Home" onclick='submitAction("<portlet:namespace/>", "ReviewerChecking", "home");'/></div>
            <div style="float:right"><input type="submit" value="Logout" onclick='submitAction("<portlet:namespace/>", "ReviewerChecking", "logout");'/></div>
            </td>
      	</tr>
<tr>
	<td colspan="3" align="center"><font color="#0000FF" size="+5">Reviewer Checking New Words</font></td>
</tr>
<tr>
	<td colspan="3" align="left">${result.dictName }</td>
</tr>
<tr>
	<td width="2%"></td>
    <td align="center" width="13%">New words</td>
    <td align="center" width="85%">Meanings</td>
</tr>
<c:forEach var="item" items="${result.listNewWords }">
	<tr>
		<td align="center">
	    	<input type="checkbox" name="wordID" value="${item.id }" />
	    </td>
	    <td align="center">${item.word }</td>
	    <td>${item.meaning }</td>
	</tr>
</c:forEach>
<tr>
	<td colspan="3">
    	<input type="submit" value="Approve" onclick='submitAction("<portlet:namespace/>", "ReviewerChecking", "approve", "${result.dictId }");'/>
        <input type="submit" value="Discard" onclick='submitAction("<portlet:namespace/>", "ReviewerChecking", "discard", "${result.dictId }");'/>
        <input type="submit" value="Back" onclick='submitAction("<portlet:namespace/>", "ReviewerChecking", "back", "${result.dictId }");'/>
    </td>
</tr>
</table>
</form>